const { getSingerAjax } = require("@/http/modules/singer");
const { createAsyncThunk, createSlice } = require("@reduxjs/toolkit");


export const getSingerInfo = createAsyncThunk("singer",async ({cat,initial})=>{
    console.log(cat,initial);
    const res = await getSingerAjax(cat,initial);
    return res.artists
})

const singer = createSlice({
    name:"singer",
    initialState:{
        singer:[]
    },
    extraReducers:{
        [getSingerInfo.fulfilled](state,{payload}){
            state.singer = payload
        }
    }
})

export default singer.reducer